<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title><tiles:insertAttribute name="title" ignore="true"/></title>
<script src="${pageContext.request.contextPath}/js/jquery.min.js" type="text/javascript"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap-theme.min.css">
<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
<link rel="stylesheet" type="text/css" href="//cdn.datatables.net/plug-ins/1.10.6/integration/bootstrap/3/dataTables.bootstrap.css">
<link  rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/front_style.css" />
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/1.10.6/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" charset="utf8" src="//cdn.datatables.net/plug-ins/1.10.6/integration/bootstrap/3/dataTables.bootstrap.js"></script>
  
<script type="text/javascript">
	$(function(){
		$.alert = function(content){
			$("#modalAlertContent").text(content);
			$("#modalAlert").modal("show");
		};
		$.alertWithCode = function(code, content){
			$("#modalAlertTitle").text(code);
			$("#modalAlertContent").text(content);
			$("#modalAlert").modal("show");
		};
		
		var activePage = "${ACTIVE_PAGE}";
		$("#"+activePage).attr("class", "active");
		$("#"+activePage).find("a").attr("class", "active");
	});
</script>

</head>

<body>
	<!------------------- Header ------------------>
	<header>
		<tiles:insertAttribute name="header"/>
	</header>
    <!--------------------------------------------->
    
    <!-------------------- body ------------------->
    <div class="container-box">
	    <div class="navigation">
	    	<c:if test="${not empty USER}">
			    <ul>
		        	<li id="slides"><a href="${pageContext.request.contextPath}/backend/slides"><span class="glyphicon glyphicon-home"></span> หน้าแรก</a></li>
			        <li id="news"><a href="${pageContext.request.contextPath}/backend/news"><span class="glyphicon glyphicon-list-alt"></span> ข่าวประชาสัมพันธ์</a></li>
		        	<li id="webboard"><a href="${pageContext.request.contextPath}/backend/webboard"><span class="glyphicon glyphicon-th-list"></span> เว็บบอร์ด</a></li>     
			        <li id="documents"><a href="${pageContext.request.contextPath}/backend/documents"><span class="glyphicon glyphicon-download-alt"></span> ดาวน์โหลด</a></li>
			        <li id="programs"><a href="${pageContext.request.contextPath}/backend/programs"><span class="glyphicon glyphicon-modal-window"></span> โปรแกรมที่เกี่ยวข้อง</a></li>
			        <li id="websites"><a href="${pageContext.request.contextPath}/backend/websites"><span class="glyphicon glyphicon-link"></span> เว็บไซต์ที่เกี่ยวข้อง</a></li>
			        <li id="menus">
			        	<a href="${pageContext.request.contextPath}/backend/menu"><span class="glyphicon glyphicon-menu-hamburger"></span> เมนู</a>
			        </li>
			    </ul>
		    </c:if>
		</div>
		<tiles:insertAttribute name="body"/>
        <div>
            &nbsp;
        </div>
	</div>
</body>
</html>

<!-- Modal -->
<div class="modal fade" id="modalAlert" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	<div class="modal-dialog">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title glyphicon glyphicon-warning-sign" id="modalAlertTitle"></h4>
			</div>
			<div class="modal-body" id="modalAlertContent">
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary" data-dismiss="modal">ปิด</button>
			</div>
		</div>
	</div>
</div>